/*
 * DeleteOriginalsAction.java
 *
 * Created on 15 April 2007, 16:37
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.cardcopier.ui;

import java.awt.event.ActionEvent;
import java.io.IOException;
import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.cardcopier.CardCopierModel;
import org.cardcopier.file.FileUtils;

/**
 *
 * @author Mark
 */
public class SelectNewFilesAction extends AbstractAction {
    
    private final FileDetailsTable fileDetailsTable;
    
    public SelectNewFilesAction(FileDetailsTable fileDetailsTable) {
        super("Select New");
        this.fileDetailsTable = fileDetailsTable;
    }

    public void actionPerformed(ActionEvent e) {
        fileDetailsTable.clearSelection();
        FileDetailsTableModel model = (FileDetailsTableModel) fileDetailsTable.getModel();
        for (int i = 0; i < model.getRowCount(); i++) {
            if (!model.fileExistsInDestination(i)) {
                fileDetailsTable.addRowSelectionInterval(i, i);
            }
        }
    }
    
}
